<!-- 1.template -->
<template>
    <div>
        <h2>父组件接收到子组件传过来的数据：{{pmsg}}</h2>
        <child @change="getVal"></child>
    </div>
</template>
<!-- 2.js代码 -->
<script>
    import Child from './Child.vue';
    export default {
        components: { Child },
        data:function(){
            return {
                pmsg:""
            }
        },
        methods:{
            getVal:function(val){
                this.pmsg=val;
            }
        }
    }
</script>
<!-- 3.css代码 -->
<style scoped>

</style>